/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "构建渲染器节点.h"

#include <节点/渲染/渲染节点.h>


static void f_渲染器配置节点_部件构建属性(C_属性栏* plane, S_结构对象指针 obj) {
	C_渲染器配置节点* 节点 = dynamic_cast<C_渲染器配置节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	S_Props prop;

	props.push_back(节点->m_分辨率);
	props.push_back(节点->m_光反弹);
	props.push_back(节点->m_光采样);
	props.push_back(节点->m_采样);
	for (auto& e : props) {
		//e.m_UI->m_Update = on_参数修改;
	}


	plane->f_构建属性部件(props);

}

C_节点面板* f_节点构建_渲染器配置(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_渲染器配置节点(*S_框架::g_3D视口环境);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_渲染器配置(plane, node);
	return plane;
}

void f_节点重置_渲染器配置(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_物体);

	plane->m_属性面板参数构建 = f_渲染器配置节点_部件构建属性;
	plane->m_ICO = "注意";
}





static void f_渲染输出节点_部件构建属性(C_属性栏* plane, S_结构对象指针 obj) {
	C_渲染输出节点* 节点 = dynamic_cast<C_渲染输出节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	S_Props prop;

	
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_渲染输出(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_渲染输出节点(*S_框架::g_3D视口环境);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_渲染输出(plane, node);
	return plane;
}

void f_节点重置_渲染输出(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_物体);

	plane->m_属性面板参数构建 = f_渲染输出节点_部件构建属性;
	plane->m_ICO = "注意";
}













